package class1;

import java.util.*;

public class Test2 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.print("请输入年,起始月,截至月:");
        int year = in.nextInt();//年
        int start = in.nextInt();//起始
        int end = in.nextInt();//终止
        //建立月日映射关系
        Map<Integer, Integer> map = new HashMap<>();
        //输出月例
        map.put(1,31);
        if((year % 4 == 0 && year % 100 != 0 || year % 400 == 0)) {
            map.put(2, 29);//run
        }else {
            map.put(2, 28);
        }
        map.put(3,31);map.put(4,30);map.put(5,31);
        map.put(6,30);map.put(7,31);map.put(8,31);
        map.put(9,30);map.put(10,31);map.put(11,30);
        map.put(12,31);
        for(int i = start; i <= end; i++) {
            System.out.print(i + "月的日历为:");
            for(int j = 1; j < map.get(i); j++) {
                System.out.print(j + " ");
            }
            System.out.println();
        }
    }
}
